home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 029a / tsbat27.zip / C.BAT < prev    next >
DOS Batch File  |  1990-03-14  |  626b  |  30 lines

  1. echo off
  2. echo Lazy changing of directory
  3. echo By Prof. Timo Salmi, ts@chyde.uwasa.fi, 14-Mar-90
  4. echo.
  5.  
  6. rem If you are fed up with typing \ in changing the directory
  7. rem this is the batch for you
  8.  
  9. rem E.g. if you have a directory \text\jokes\stupid the just use
  10. rem c text jokes stupid
  11. rem Applying c without parameters takes you to the root directory
  12.  
  13. :_loop
  14. set tmp_=%tmp_%\%1
  15. shift
  16. if not "%1"=="" goto _loop
  17.  
  18. if not "%tmp_%"=="\" if not exist %tmp_%\nul goto _error
  19.  
  20. echo Changing directory to %tmp_%
  21. cd %tmp_%
  22. goto _out
  23.  
  24. :_error
  25. echo Directory %tmp_% does not exist
  26.  
  27. :_out
  28. set tmp_=
  29. echo on
  30.